var ArticleModel = require('./model/article.js');
var ArticlecateModel = require('./model/articlecate.js');
var User = require('./model/user');
//查询Article 表的数据

queryAllArticle(); //查询全部新闻信息


function queryAllArticle() {
  //文章表和 分类表的关联
  // ArticleModel.find({}).populate('cid').exec(function(err,docs){
  // 	console.log(docs);
  // })

  console.log(arguments.callee.toString())
  //三个表关联
  ArticleModel.find({}).populate('cid').populate('author_id').exec(function (err, docs) {
    console.log(docs);
  })

  // ArticleModel.aggregate  建议使用
}